const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
    mode:"development",
    devtool: "source-map",
    module:{
        rules:[
            // {
            //     test: /\.(png)|(gif)|(jpg)$/,
            //     use: [{
            //         loader: "file-loader",
            //         options: {
            //             name: "imgs/[name].[hash:5].[ext]"
            //         }
            //     }]
            // },
            {
                test: /\.(png)|(gif)|(jpg)$/,
                use: [{
                    loader: "url-loader",
                    options: {
                        name: "imgs/[name].[hash:5].[ext]",
                        limit: 10 * 1024
                    }
                }]
            },
            {
                test: /\.css$/,
                use:['style-loader', 'css-loader']
            }
        ]
    },
    // devServer:{
    //     port: 8000,
    //     open: true,
    // },
    plugins:[
        new HtmlWebpackPlugin()
    ]
}